package com.service.impl;

import com.bean.Stock;
import com.dao.StockDao;
import com.dao.impl.StockDaoImpl;
import com.service.StockService;

import java.util.List;

public class StockServiceImpl implements StockService {
    private StockDao stockDao = new StockDaoImpl();
    @Override
    public List<Stock> showStocks() {
        return stockDao.showStocks();
    }

    @Override
    public Stock showStock(int key) {
        return stockDao.showStock(key);
    }

    @Override
    public List<Stock> findStock(String startNumb, String endNumb, String type, String name) {
        return stockDao.findStock(startNumb,  endNumb,  type,  name);
    }

    @Override
    public boolean updateSellPrice(int key, int sellPrice) {
        if (stockDao.updateSellPrice(key , sellPrice) > 0) {
            return true;
        }else {
            return false;
        }
    }
}
